package chapter01
/**
 * @ 运算符
 * https://www.w3cschool.cn/groovy/groovy_operators.html
 *
 *
*/

class MyOperation {


    static def add(int a, int b) {
        return a + b
    }


    static void main(String[] args) {

        def range = 1..5;
        println(range);
        // 打印range 值
        range.each { print(it)};
        println(
                ""
        )


        int result = add(5,10);
        println("result: ${result}")

        int a = 10;
        int b = 20 ;

        println("${a} + ${b} = ${add(a,b)}");
        println("${a} - ${b} = ${a - b}");
        println("${a} * ${b} = ${a * b}");
        println("${a} / ${b} = ${a / b}");
        println("${a} % ${b} = ${a % b}");

//        println(range.get(0));
//        println(range.get(2));

    }
}
